<%@ page contentType="text/html; charset=UTF-8"   %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<table id="gridExpensesInfo">
</table>
<script>
	$(function(){
		$("#gridExpensesInfo").datagrid({
		url:'ExpensesInfoServlet.servlet?opt=expensesInfoListIndexView',
		fit:true,
		border:false,
		singleSelect:true,
		pagination:true,
		columns:[[
		{field:'teamName',title:'所属团体',width:'80'},
		{field:'discription',title:'备注',width:'120'},
		{field:'generatedDate',title:'费用日期',width:'80',align:'right'},
		{field:'eid',title:'ID',width:'0'},
		{field:'action',title:'操作',width:'80',formatter:function(i,row){
			var actions= '<a href="javascript:updateSingleData('+row.eid+');" >修改</a>&nbsp;&nbsp;';
			actions+='<a href="javascript:deleteSingleData('+row.eid+');" >删除</a>';
			return actions;
		}}
		]]
		});
	});
	
	
	//删除费用
	function deleteSingleData(eid){
		if(confirm('是否确定删除?')){
			window.location.href="ExpensesInfoServlet.servlet?opt=deleteSingleData&eid="+eid;
		}
	}
	
	//修改费用
	function updateSingleData(eid){
		window.location.href="ExpensesInfoServlet.servlet?opt=toUpdateSingleData&eid="+eid;
	}
</script>